<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <!-- 引入bootstarp -->
    <script type="text/javascript" src="../js/bootstrap3/js/bootstrap.js"></script>
    <link rel="stylesheet" href="../js/bootstrap3/css/bootstrap.css">
    <!-- 引入bootstrap table的css、js -->
    <link type="text/css" rel="stylesheet" href="../js/bootstrap-table/bootstrap-table.css">
    <script type="text/javascript" src="../js/bootstrap-table/bootstrap-table.js"></script>
    <script type="text/javascript" src="../js/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <!-- 引入bootstrap datetime的css、js -->
    <link type="text/css" rel="stylesheet" href="../js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css">
    <script type="text/javascript" src="../js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="../js/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
<div id="toolbar">
    <button onclick="daifukuan()" type="button" class="btn btn-success"> 待付款</button>
    <button onclick="daifahuo()" type="button" class="btn btn-danger"> 待发货</button>
    <button onclick="daipingjiadingdan()" type="button" class="btn btn-danger"> 全部订单</button>
</div>
<div class="table" id="userTable"></div>
</body>
<script>
    function daipingjiadingdan(){
        location.href="../page/toyimaidao";
    }
    function daifukuan(){
        location.href="../page/daifukuan";
    }
    function daifahuo(){
        location.href="../page/daifahuo";
    }
    function daipingjia(){
        location.href="../page/daipingjia";
    }

    $(function(){
        initdaifukuan();
    })
    function searchBook(){
        $("#userTable").bootstrapTable('refresh',{
            query:{
                page:'1',
            }
        });
    }
    function initdaifukuan(){
        $("#userTable").bootstrapTable({
            toolbar:'#toolbar',
            url:'../wjs/daifukuan',
            method:'post',
            contentType:'application/x-www-form-urlencoded',//post请求按照表单方式
            pagination:true,
            pageSize:5,
            pageList:[2,5,6],
            pageNumber:1,
            clickToSelect: true,         //是否启用点击选中行
            sidePagination:'server',        //分页方式：client客户端分页，server服务端分页
            striped:true,          //斑马线
            queryParams:function(){
                return {
                    page:this.pageNumber,
                    rows:this.pageSize
                };
            },
            columns:[
                {field:'orderNo',title:'订单号',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }},
                {field:'productName',title:'商品',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }},
                {field:'storeName',title:'店铺',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }},
                {field:'danjia',title:'价格',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }},
                {field:'shuliang',title:'数量',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }},
                {field:'jiaoyitai',title:'付款',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }},
                {field:'orderCreateTime',title:'时间',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }},
                {field:'productImg',title:'图片',formatter:function (value,row,index){
                        return '<img src="'+value+'" width="50px" height="50px">'
                    }},
                {field:'logisticsStatus',title:'是否确认收货',formatter:function(value,row,index){
                        return '<a href="">'+value+'</a>'
                    }}
            ]
        })
    }

    $('.date').datetimepicker({
        language: 'zh-CN',//显示中文
        format: 'yyyy-mm-dd hh:ii:ss',//显示格式
        minView: "month",//设置只显示到月份
        initialDate: new Date(),//初始化当前日期
        autoclose: true,//选中自动关闭
        todayBtn: true//显示今日按钮
    });

</script>
</html>